package com.weixing.oauth2.common.userdetails;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;

/**
 * @ClassName IUserAuthService
 * @Description
 * @Author Small
 * @Date 2019/12/30 11:49
 * @Version 1.0
 **/
public interface IUserAuthService {
    SecurityUser loadUserByUsername(String loginName);
    SecurityUser loadUserByOpenId(String openId);
    SecurityUser loadUserByXcxOpenId(String openId);


    void handlerLoginData(HttpServletRequest request, SecurityUser securityUser);

    UserDetails loadUserByMobile(String mobile) throws UsernameNotFoundException;

    Collection<GrantedAuthority> loadAuthority(Long userId);

    UserDetails loadUserByPhoneAndPassword(String phone, String password);

    UserDetails loadUserByPhoneAndSmsCode(String phone, String smsCode);
}
